package com.zrar.ak.gkpt.dao;

import com.zrar.ak.gkpt.model.bo.BusinessFundManageFundDetailsBO;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

/**
 * @ClassName: IBusinessFundManageFundDetailsDao
 * @Description 资金管理-资金明细表Dao层
 * @Author HuangKeXin
 * @Time 2020/04/3
 */
@Repository("businessFundManageFundDetailsDao")
public interface IBusinessFundManageFundDetailsDao extends Mapper<BusinessFundManageFundDetailsBO> {
    @Select(("SELECT COUNT(1) AS TOTAL FROM BUSINESS_FUND_MANAGE_FUND_DETAILS WHERE IS_DELETE='0' AND UNIT_ID=#{unitId}"))
    Integer queryExistCountByFoundManageDetailsUnitId(String unitId);
    /*@Select(("SELECT COUNT(1) AS TOTAL FROM BUSINESS_ACCOUNT_BASIC_INFO WHERE IS_DELETE='0' AND UNIT_ID=#{unitId}"))
    Integer queryExistCountByAccountInfoUnitId(String unitId);*/
    @Update(" UPDATE BUSINESS_FUND_MANAGE_FUND_DETAILS SET IS_DELETE='1' WHERE IS_DELETE='0' AND UNIT_ID = #{unitId}")
    void deleteFundManageByUnitId(String unitId);

    Integer queryFoundManageShowNum(Map map);

    List<BusinessFundManageFundDetailsBO> pagingQueryFoundManageList(Map map);
}
